1. Field of the Invention
The present invention relates to data searching methods, and more specifically to a data searching method by partial matching of a character string.
2. Related Art Statement
A data search by partial matching of a character string means that when a character string S is given as a search condition to a database in which N data items having a character-string-type attribute value M are registered, a data item whose attribute value M includes the character string S is selected therefrom. Conventionally, when this kind of search is executed, it is verified whether "the attribute value M includes the character string S" for each of N data items registered in the database.
However, in the above searching method, it has to be verified whether "the attribute value M includes the character string S" N times. Therefore, for example, when a database which registers a large amount of data more than hundred thousand items is searched, it disadvantageously requires extremely long time to complete the search.
Therefore, conventionally, before searching by partial matching of a character string to verify whether "the attribute value M includes the character string S", a search is performed with another search condition C capable of faster searching, thereby narrowing down data to be searched by partial matching of a character string.
For example, consider the case where a photo data item of "Udon" (a kind of Japanese noodles) is selected from a database in which photo data items of food menu are registered. In each photo data item, in addition to the name of the menu such as "Tempura-udon", "Udon-suki (Sukiyaki with Udon)", "Soba (another kind of Japanese noodles)", "Curry", "Fried rice", etc, indexes are further included indicating distinctions such as "Japanese", "Western", "Chinese"; "Noodles", "Rice", etc. Before the photo data item including the character string of "Udon" in the title is selected from this database, processing of extracting a photo data item including the index indicating, for example, "Noodles", is performed (an index search is extremely fast compared to a search by partial matching of a character string). Data to be searched by partial matching of a character string is thereby narrowed down, resulting in saving time required to complete the search.
However, how much time required to complete the search is saved depends on which condition to be selected as the above search condition C. For example, in the case of searching for "Udon", it is expected that the time required to complete the search will be different between when the data to be searched is narrowed down to "Noodles" and when the data to be searched is narrowed down to "Japanese". Therefore, in the above searching method, at worst, the data to be searched cannot be narrowed down at all. In this case, the time to complete the search is not saved. Further, even if an appropriate condition is selected, when the number of data items N registered in the database is large, the number of applicable items to be searched obtained by narrowing down with the search condition C becomes large, also resulting in long time for searching.